﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;

namespace EcoSystem
{
    public interface IScriptAppService : ISingletonDependency
    {
        /// <summary>
        /// 注册API接口方法
        /// </summary>
        /// <param name="methodName"></param>
        /// <param name="content"></param>
        /// <param name="args"></param>
        void RegisterMethod(string methodName, string content, string[] args);

        /// <summary>
        /// 执行方法
        /// </summary>
        /// <typeparam name="TResult"></typeparam>
        /// <param name="methodName"></param>
        /// <param name="args"></param>
        /// <returns></returns>
        TResult ExecuteMethod<TResult>(string methodName, Dictionary<string, object> args);

        /// <summary>
        /// 执行脚本
        /// </summary>
        /// <param name="content"></param>
        void ExecuteScript(string content);

        /// <summary>
        /// 注册脚本
        /// </summary>
        /// <typeparam name="TResult"></typeparam>
        /// <param name="content"></param>
        /// <returns></returns>
        TResult ExecuteScript<TResult>(string content);
    }
}
